package com.fanfan.demo.response;

import lombok.Data;

/**
 * @Author: fanfan
 * @Date: 2019/4/14 11:58
 * @description: 1.0
 */
@Data
public class BaseResponse<T> {

    private static String SUCCESS_CODE="200";
    private static String SUCCESS_MSG="成功";

    private String respCode;

    private String respMsg;

    private T data;

    public BaseResponse(){

    }

    public void success(T data){
        this.respCode = SUCCESS_CODE;
        this.respMsg = SUCCESS_MSG;
    }

    public static<T> BaseResponse TSuccess(T data){
        BaseResponse response = new BaseResponse();
        response.success(data);
        return response;
    }
}
